$.namespace("common.textEditor");

common.textEditor.commonOpts=null;
common.textEditor.editorPop=null;
common.textEditor.mainContent=null;
common.textEditor.editorFlag=false;
common.textEditor.allHrefPath={};
common.textEditor.autoNumber=0;

common.textEditor.init=function (opts){
	opts = opts || {};
	common.textEditor.editorFlag=false;
	var path=$("script[src$='js/textEditor-1.0.js']").attr("src");
	var localPath=path.replace("js/textEditor-1.0.js","");
	var item = $("<div><iframe src='"+localPath+"html/textEditorMainPage.html' style='width:100%;height:100%;border:none;'></iframe></div>").appendTo("body");
	//console.log(localPath);
	/*$.loadScript.load("http://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js").done(function(){*/
	/*$.loadScript.load(localPath+"textEditorControl.js").done(function(){*/
		liandisys.dialog.showWindowByItem({
			 item: item,
			 noheader:true,
	       // href: localPath + 'textEditorMainPage.html' ,
	        resizable: false,
	        title: opts.title || "文本编辑",
	        width: opts.width || 800,
	        height: opts.height || 700
	    });
	/*});*/
	/*});*/
	opts.win = item;
	item.find("iframe")[0].contentWindow.opts = opts;
	localPath=localPath.substring(1);
	var index=localPath.indexOf("/");
	item.find("iframe")[0].contentWindow.localPath = localPath.substring(index);
};



/**/